# get pid
get_pid(){
 pname="bootj2cache.war"
 pid=`ps -ef | grep $pname | grep -v grep | awk '{print $2}'`
 echo "$pid"
}

ps -ef|grep bootj2cache.war

PID=$(get_pid)
if [ -z "${PID}" ] 
then
 echo -e "\r\nJava Application already stop!"
else
 echo -e '\r\nkill -9  '${PID}
 kill -9 ${PID}
 echo -e "Java Application is stop!"
fi

rm -rf info.log

echo -e "\r\nJava Application will startup!"
nohup java -jar /work/demo/bootj2cache.war -Xms64m -Xmx64m --server.port=8081 >>./info.log 2>&1 &
sleep 10s
nohup java -jar /work/demo/bootj2cache.war -Xms64m -Xmx64m --server.port=8082 >>./info.log 2>&1 &

ps -ef|grep bootj2cache.war

echo -e "please visit: http://test.001fly.top/user/"

#tail -f info.log

